/***********************************************************************
 *
 * MODULE NAME:    sdp_ue.h
 * PROJECT CODE:   host side stack
 * DESCRIPTION:    Service Discovery Test code
 * MAINTAINER:     Mark Donnelly
 *
 * SOURCE CONTROL: $Id: sdp_ue.h,v 1.3 2009/08/25 06:07:53 jianguo Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000 RDA Microelectronics
 *     All rights reserved.
 *
 * REVISION HISTORY:
 * 
 *
 * ISSUES:
 * 
 ***********************************************************************/
#include "host_config.h"
#include "l2cap_primitives.h"

#if SDP_CLIENT


#ifndef SDP_UE_H
#define SDP_UE_H

#include "sdp.h"
/*
  
  Types definitions
  
*/

#define RDABT_SDP_BASE_RX_BUFFER_SIZE 250
#define RDABT_SDP_MAX_RESULTS_SIZE 16*1024


typedef struct {
  u_int8 trust;
  u_int8 connection;
} SDPRelation;

typedef struct {
  u_int16 numItems;
  t_bdaddr *addresses;
} t_SDP_Addresses;

typedef struct{
  u_int16 status;
  u_int8 type;
  u_int16 length;
  u_int8* pData;
  u_int8 Continue[17];
} t_SDP_LowLevelResults;

typedef void (*sdp_api_callback)(u_int8 status);
struct rdabt_sdp_primitive_task;

void SDP_RegisterPSM(void); 
APIDECL1 int APIDECL2 SDP_TerminatePrimitive(struct rdabt_sdp_primitive_task *pTask);

APIDECL1 int APIDECL2 SDP_ServiceSearch(t_bdaddr* address, t_SDP_SearchPattern *pattern, 
						t_SDP_AttributeIDs *attributes, t_SDP_StopRule *rule, u_int8 module_id);

APIDECL1 int APIDECL2 SDP_ServiceBrowse(t_bdaddr* address, t_SDP_SearchPattern *pattern, 
						t_SDP_AttributeIDs *attributes, t_SDP_StopRule *rule, u_int8 module_id);

APIDECL1 int APIDECL2 SDP_GenericBrowse(t_bdaddr* address,
						t_SDP_AttributeIDs *attributes, t_SDP_StopRule *rule, u_int8 module_id);


APIDECL1 int APIDECL2 SDP_ServiceSearchRequest(t_SDP_LowLevelResults** pResults,t_channelId cid, t_SDP_SearchPattern* pPattern, u_int16 maxCount, u_int8* Continue, u_int8 timeout, sdp_api_callback callback);
APIDECL1 int APIDECL2 SDP_ServiceAttributeRequest(t_SDP_LowLevelResults** pResults, t_channelId cid, u_int32 handle, t_SDP_AttributeIDs* pAttributes, u_int16 maxBytes, u_int8* Continue, u_int8 timeout, sdp_api_callback callback);
APIDECL1 int APIDECL2 SDP_ServiceSearchAttributeRequest(t_SDP_LowLevelResults** pResults, t_channelId cid, t_SDP_SearchPattern* pPattern, t_SDP_AttributeIDs* pAttributes, u_int16 maxBytes, u_int8* Continue, u_int8 timeout, sdp_api_callback callback);

APIDECL1 int APIDECL2 SDP_ConnectTransport(t_bdaddr* address, u_int16 mtu,void (*configured)(u_int8,t_L2_ControlCallbackArgs *),void (*disconnect)(u_int8 type,t_L2_ControlCallbackArgs *));
APIDECL1 int APIDECL2 SDP_DisconnectTransport(t_channelId cid);


t_api rdabt_sdp_cli_layer_ctrl(u_int8 flags);

#endif /* SDP_CLIENT */
#endif /* SDP_UE_H */

